﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="m_cartorder.ascx.cs" Inherits="administrator_uc_admin_m_cartorder" %>
<%@ Register Assembly="AjaxControlToolkit, Version=3.5.50401.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e"
    Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register src="~/administrator/uc_admin/mn_top.ascx" tagname="mn_top" tagprefix="uc1" %>
<%@ Register src="~/administrator/uc_admin/mn_bottom.ascx" tagname="mn_bottom" tagprefix="uc2" %>
<div id="managecontent">
    <div id="managecontent_title">
        <h3>QUẢN LÝ ĐƠN HÀNG</h3>
    </div>
    <br class="clrfix" />
    <div id="managecontent-header">
        <div id="managecontent_feature">
        <script language="javascript">
            function CallFuncEditItem() {
                document.getElementById('<%= btnEditItem.ClientID%>').click();
            }
            function CallFuncDeleteItem() {
                if (confirm('Are you sure?')) {
                    document.getElementById('<%= btnDeleteItem.ClientID%>').click();
                }
            }
        </script>
        <uc1:mn_top ID="mn_top" runat="server" /> 
        </div>               
           
        <div id="managecontent_search">
           

           <span class="clsFormatDate">Order Status</span> 
            <asp:DropDownList ID="drd_OrderStatus" runat="server" AppendDataBoundItems="true">
              <asp:ListItem Value="0">---Tất cả--</asp:ListItem>
                
            </asp:DropDownList>

            <span class="clsFormatDate">From date</span> 
            <asp:TextBox ID="txtFromDate" runat="server" Width="80px"></asp:TextBox>
            <asp:CalendarExtender ID="CalendarExtenderDate1" runat="server" TargetControlID="txtFromDate" Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
            </asp:CalendarExtender>
            <span class="clsFormatDate">To date</span>
            <asp:TextBox ID="txtToDate" runat="server" Width="80px"></asp:TextBox>
            <asp:CalendarExtender ID="CalendarExtenderDate2" runat="server" TargetControlID="txtToDate" Format="dd/MM/yyyy" TodaysDateFormat="dd/MM/yyyy">
            </asp:CalendarExtender>
            <span class="clsFormatDate">Oreder Id</span> 
            <asp:TextBox ID="txtKeyWord" runat="server"></asp:TextBox>
            <asp:LinkButton ID="lbtSearch" runat="server"            
                onclick="lbtSearch_Click"> <img src="../images/icons/icon_search.gif" border="0px" /><b>Search</b> </asp:LinkButton>

                <div class="resultsearch" > <asp:Literal ID="ltresultSearch" runat="server"></asp:Literal></div> 
        </div>

     
    </div>
    <br class="clrfix" />
    <asp:GridView ID="gv_ManageControl" runat="server" AutoGenerateColumns="False" EmptyDataText = "Không có đơn hàng nào!"
        DataKeyNames="Id" Width="910px" AllowPaging="True"
        onpageindexchanging="gv_ManageControl_PageIndexChanging" PageSize="20" 
        AllowSorting="True" onsorting="gv_ManageControl_Sorting">
        <Columns>
             <asp:TemplateField > 
                <HeaderTemplate>
                    <input id="checkAll" style="float:left;" onclick="javascript:SelectAllCheckBoxes(this);" 
                          runat="server" type="checkbox" />
                </HeaderTemplate>            
                <ItemTemplate>
                    <asp:CheckBox ID="chkCheck" runat="server" />
                    <asp:HiddenField ID="hdItemKeyFieldID" runat="server" Value='<%#Bind("OrderId") %>' />
                </ItemTemplate>
             </asp:TemplateField>                  
             <asp:BoundField DataField="Id" HeaderText="Order Id" SortExpression="Id" />
             <asp:BoundField DataField="FullName" HeaderText="Customer" 
                 SortExpression="FullName" />             
             <asp:BoundField DataField="Email" HeaderText="Email" />                    
             <asp:BoundField DataField="PhoneNumber" HeaderText="Phone number" />
             <asp:BoundField DataField="Created" HeaderText="Created" 
                 SortExpression="Created" DataFormatString="{0:dd/MM/yyyy-hh:mm}" />
            <asp:TemplateField HeaderText="View">
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate> 
                 <a href="javascript:ViewItem('v_cartorder','ViewItem','<%# Eval("OrderId") %>','860','500');" title="View"><img src="../images/icons/icon-view.png" border="0px"/></a>            
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Edit">
                <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate> 
                 <a href="javascript:EditItem('e_cartorder','EditItem','<%# Eval("OrderId") %>','860','500');" title="Edit"><img src="../images/icons/icon_edit.bmp" border="0px"/></a>            
            </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Delete">
            <ItemStyle HorizontalAlign="Center" Width="30px" />
            <ItemTemplate>
                 <a href="javascript:DeleteOrderItem('<%# Eval("OrderId") %>');" title="Delete"><img src="../images/icons/icon_delete.jpg" border="0px"/></a>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="Silver" />
        <HeaderStyle Font-Bold="True" BackColor="Silver" Font-Size="14px" 
            Height="26px" />
        <PagerSettings FirstPageText="trang đầu-" LastPageText="-trang cuối" 
            Mode="NumericFirstLast" NextPageText="-trang sau-" 
            PreviousPageText="-trang trước-" Position="TopAndBottom" />
        <PagerStyle BackColor="Silver" />
        <RowStyle Height="25px" CssClass="rowStyle" />
    
    </asp:GridView>
    <br class="clrfix" />
    <div id="AddNewItem">
        <uc2:mn_bottom ID="mn_bottom" runat="server" />
        <asp:HiddenField ID="hdItemID" runat="server" />
        <asp:Button ID="btnEditItem" runat="server" CssClass="featurehidden" onclick="btnEditItem_Click" />
        <asp:Button ID="btnDeleteItem" runat="server" CssClass="featurehidden" onclick="btnDeleteItem_Click" />
    </div>
</div>